home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’95 / CyberProcDoggie / Source Code / Woof / Woof_Real / RealWoofStream.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-24  |  1.9 KB  |  77 lines  |  [TEXT/MPS ]

  1. #ifndef RealWoofStream_h
  2. #define RealWoofStream_h
  3.  
  4. #include "RealCyberStream.h"
  5.  
  6. //#include "Debug.h"
  7.  
  8. #include "WoofLibraryDef.h"
  9. //#include "EvenMoreTCP.h"
  10.  
  11. class TBufferManager;
  12.  
  13.  
  14. // %%%
  15. typedef int TDoggieTalkConnection;
  16.  
  17. #define kDoggieDoneRead 1
  18. #define kDoggieClosed 2
  19. #define kDoggieError 3
  20.  
  21. #define kArbitraryBufferSize 512
  22.  
  23.  
  24. class TRealWoofStream : public TRealCyberStream
  25. {
  26. public:
  27.                                     TRealWoofStream();
  28.             virtual                    ~TRealWoofStream();
  29.                             
  30.             OSErr                    Initialize(char* url);
  31.  
  32.             virtual StreamStatus    GetStreamStatus(Environment* ev);
  33.             virtual OSErr            GetStreamError(Environment* ev);
  34.             virtual    void            GetStatusString(Environment* ev, char* message);
  35.             virtual    short            GetTotalDataSize(Environment* ev);
  36.  
  37.             virtual    OSErr            OpenWithCallback(Environment* ev, CyberStreamNotifyUPP callback, void* userData);
  38.             virtual    OSErr            Open(Environment* ev);
  39.             
  40.             virtual    void            GetBuffer(Environment* ev, Ptr* buffer, Size* bufferSize);
  41.             virtual    void            ReleaseBuffer(Environment* ev, Ptr buffer);
  42.  
  43.             virtual void            Abort(Environment* ev);
  44.             
  45. private:
  46.             StreamStatus            fStreamStatus;
  47.             short                    fStreamSize;
  48.             OSErr                    fStreamError;
  49.             // host address
  50.             char                    *fNameText;
  51.             short                    fNameLength;
  52.  
  53.             Boolean                    fOnHold;
  54.             Boolean                    fOpen;
  55.             Boolean                    fImmediate;
  56.  
  57.             TBufferManager*            fBufferManager;
  58.  
  59.             TDoggieTalkConnection*    fDoggieTalk;
  60.             void*                    fClientUserData;
  61.             CyberStreamNotifyUPP    fClientNotifier;
  62.  
  63.             char*                    fImmediateBuffer;
  64.             Size                    fImmediateBufferLength;
  65.  
  66.             void                    GetSynchronousData(char* buffer, Size* bufferLength);
  67.  
  68.             void                    DoggieProcessEvent(Environment* ev, unsigned short eventCode, Ptr buffer, Size bufferSize, OSErr result);
  69.  
  70.             static void                DoggieNotifier(unsigned short eventCode, Ptr buffer, Size bufferSize, OSErr result, void* userDataPtr);
  71.             static void                ContinueReading(void* userData, OSErr result);
  72.  
  73. };
  74.  
  75.  
  76. #endif    // RealWoofStream_h
  77.